/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-09 14:43:05
*/


-- ----------------------------
-- Table structure for tesla_830_header
-- ----------------------------
DROP TABLE [dbo].[tesla_830_header]
GO
CREATE TABLE [dbo].[tesla_830_header] (
[id] nvarchar(50) NOT NULL ,
[status] int NULL ,
[create_datetime] datetime NULL ,
[forecast_order_number] nvarchar(30) NULL ,
[release_number] nvarchar(30) NULL ,
[schedule_qty_type] nvarchar(30) NULL ,
[customer_po_date] datetime NULL ,
[forecast_start_date] datetime NULL ,
[forecast_end_date] datetime NULL ,
[dock_number] nvarchar(30) NULL ,
[ship_from_name] nvarchar(60) NULL ,
[ship_from_id] nvarchar(80) NULL ,
[ship_from_address] nvarchar(55) NULL ,
[ship_from_address_add] nvarchar(55) NULL ,
[ship_from_city] nvarchar(30) NULL ,
[ship_from_state] nvarchar(2) NULL ,
[ship_from_postal] nvarchar(15) NULL ,
[ship_to_name] nvarchar(60) NULL ,
[ship_to_id] nvarchar(80) NULL ,
[ship_to_address] nvarchar(55) NULL ,
[ship_to_address_add] nvarchar(55) NULL ,
[ship_to_city] nvarchar(30) NULL ,
[ship_to_state] nvarchar(2) NULL ,
[ship_to_postal] nvarchar(15) NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_830_header
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_830_header
-- ----------------------------
ALTER TABLE [dbo].[tesla_830_header] ADD PRIMARY KEY ([id])
GO

DROP TABLE [dbo].[tesla_830_item]
GO
CREATE TABLE [dbo].[tesla_830_item] (
[id] nvarchar(50) NOT NULL ,
[header_id] nvarchar(50) NULL ,
[line_item_number] nvarchar(6) NULL ,
[buyer_product_number] nvarchar(48) NULL ,
[unit] nvarchar(2) NULL ,
[expeditor_name] nvarchar(60) NULL ,
[expeditor_tel_number] nvarchar(80) NULL ,
[cumulative_qty] decimal(15,3) NULL ,
[cumulative_shipped_start_date] datetime NULL ,
[cumulative_shipped_end_date] datetime NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_830_item
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_830_item
-- ----------------------------
ALTER TABLE [dbo].[tesla_830_item] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[tesla_830_item]
-- ----------------------------
ALTER TABLE [dbo].[tesla_830_item] ADD FOREIGN KEY ([header_id]) REFERENCES [dbo].[tesla_830_header] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION

/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-09 16:49:26
*/


-- ----------------------------
-- Table structure for tesla_830_plan
-- ----------------------------
DROP TABLE [dbo].[tesla_830_plan]
GO
CREATE TABLE [dbo].[tesla_830_plan] (
[id] nvarchar(50) NOT NULL ,
[item_id] nvarchar(50) NULL ,
[forecasted_qty] decimal(15,3) NULL ,
[forecasted_qualifer] nvarchar(30) NULL ,
[forecasted_date] datetime NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_830_plan
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_830_plan
-- ----------------------------
ALTER TABLE [dbo].[tesla_830_plan] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[tesla_830_plan]
-- ----------------------------
ALTER TABLE [dbo].[tesla_830_plan] ADD FOREIGN KEY ([item_id]) REFERENCES [dbo].[tesla_830_item] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-09 16:49:37
*/


-- ----------------------------
-- Table structure for tesla_862_header
-- ----------------------------
DROP TABLE [dbo].[tesla_862_header]
GO
CREATE TABLE [dbo].[tesla_862_header] (
[id] nvarchar(50) NOT NULL ,
[status] int NULL ,
[create_datetime] datetime NULL ,
[contract_number] nvarchar(30) NULL ,
[document_date] datetime NULL ,
[plan_start_date] datetime NULL ,
[plan_end_date] datetime NULL ,
[release_number] nvarchar(30) NULL ,
[plan_qty_type] nvarchar(30) NULL ,
[ship_from_name] nvarchar(60) NULL ,
[ship_from_id] nvarchar(80) NULL ,
[ship_from_address] nvarchar(55) NULL ,
[ship_from_address_add] nvarchar(55) NULL ,
[ship_from_city] nvarchar(30) NULL ,
[ship_from_state] nvarchar(2) NULL ,
[ship_from_postal] nvarchar(15) NULL ,
[ship_to_name] nvarchar(60) NULL ,
[ship_to_id] nvarchar(80) NULL ,
[ship_to_address] nvarchar(55) NULL ,
[ship_to_address_add] nvarchar(55) NULL ,
[ship_to_city] nvarchar(30) NULL ,
[ship_to_state] nvarchar(2) NULL ,
[ship_to_postal] nvarchar(15) NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_862_header
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_862_header
-- ----------------------------
ALTER TABLE [dbo].[tesla_862_header] ADD PRIMARY KEY ([id])
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-09 16:49:44
*/


-- ----------------------------
-- Table structure for tesla_862_item
-- ----------------------------
DROP TABLE [dbo].[tesla_862_item]
GO
CREATE TABLE [dbo].[tesla_862_item] (
[id] nvarchar(50) NOT NULL ,
[header_id] nvarchar(50) NULL ,
[line_item_number] nvarchar(20) NULL ,
[buyer_item_number] nvarchar(48) NULL ,
[unit] nvarchar(2) NULL ,
[dock_number] nvarchar(30) NULL ,
[receiving_dock_name] nvarchar(60) NULL ,
[receiving_dock_tel_number] nvarchar(80) NULL ,
[cumulative_qty] decimal(15,3) NULL ,
[cumulate_shipped_start_date] datetime NULL ,
[cumulate_shipped_end_date] datetime NULL ,
[transportation_type] nvarchar(30) NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_862_item
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_862_item
-- ----------------------------
ALTER TABLE [dbo].[tesla_862_item] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[tesla_862_item]
-- ----------------------------
ALTER TABLE [dbo].[tesla_862_item] ADD FOREIGN KEY ([header_id]) REFERENCES [dbo].[tesla_862_header] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-12 10:35:26
*/


-- ----------------------------
-- Table structure for tesla_862_plan
-- ----------------------------
DROP TABLE [dbo].[tesla_862_plan]
GO
CREATE TABLE [dbo].[tesla_862_plan] (
[id] nvarchar(50) NOT NULL ,
[item_id] nvarchar(50) NULL ,
[forecasted_qty] decimal(15,3) NULL ,
[forecaste_qualifer] nvarchar(30) NULL ,
[forecaste_time] nvarchar(30) NULL ,
[forecaste_start_date] datetime NULL ,
[forecaste_end_date] datetime NULL ,
[requested_ship_date] datetime NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_862_plan
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_862_plan
-- ----------------------------
ALTER TABLE [dbo].[tesla_862_plan] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[tesla_862_plan]
-- ----------------------------
ALTER TABLE [dbo].[tesla_862_plan] ADD FOREIGN KEY ([item_id]) REFERENCES [dbo].[tesla_862_item] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-12 10:35:37
*/


-- ----------------------------
-- Table structure for tesla_824_header
-- ----------------------------
DROP TABLE [dbo].[tesla_824_header]
GO
CREATE TABLE [dbo].[tesla_824_header] (
[id] nvarchar(50) NOT NULL ,
[status] int NULL ,
[create_datetime] datetime NULL ,
[vendor_invoice_number] nvarchar(30) NULL ,
[vendor_invoice_date] datetime NULL ,
[message_from_name] nvarchar(60) NULL ,
[information_contact] nvarchar(60) NULL ,
[contact_type] nvarchar(60) NULL ,
[communication_number] nvarchar(80) NULL ,
[message_to_name] nvarchar(60) NULL ,
[message_to_id] nvarchar(80) NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_824_header
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_824_header
-- ----------------------------
ALTER TABLE [dbo].[tesla_824_header] ADD PRIMARY KEY ([id])
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-12 10:35:45
*/


-- ----------------------------
-- Table structure for tesla_824_detail
-- ----------------------------
DROP TABLE [dbo].[tesla_824_detail]
GO
CREATE TABLE [dbo].[tesla_824_detail] (
[id] nvarchar(50) NOT NULL ,
[header_id] nvarchar(50) NULL ,
[application_ack] nvarchar(2) NULL ,
[vendor_invoice_no] nvarchar(30) NULL ,
[error_code] nvarchar(3) NULL ,
[error_description] nvarchar(60) NULL ,
[corrective_actions] nvarchar(60) NULL 
)


GO

-- ----------------------------
-- Indexes structure for table tesla_824_detail
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_824_detail
-- ----------------------------
ALTER TABLE [dbo].[tesla_824_detail] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[tesla_824_detail]
-- ----------------------------
ALTER TABLE [dbo].[tesla_824_detail] ADD FOREIGN KEY ([header_id]) REFERENCES [dbo].[tesla_824_header] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-12 10:35:54
*/


-- ----------------------------
-- Table structure for tesla_856_header
-- ----------------------------
DROP TABLE [dbo].[tesla_856_header]
GO
CREATE TABLE [dbo].[tesla_856_header] (
[id] nvarchar(50) NOT NULL ,
[status] int NULL ,
[create_datetime] datetime NULL ,
[notice_number] nvarchar(30) NULL ,
[packing_slip_number] nvarchar(30) NULL ,
[shipment_date] datetime NULL ,
[gross_weight] decimal(20) NULL ,
[gross_weight_unit] nvarchar(2) NULL ,
[actual_net_weight] decimal(20) NULL ,
[actual_net_weight_unit] nvarchar(2) NULL ,
[packing_type] nvarchar(5) NULL ,
[lading_qty] decimal(7) NULL ,
[weight] decimal(10,3) NULL ,
[weight_unit] nvarchar(2) NULL ,
[volume] decimal(8) NULL ,
[volume_unit] nvarchar(2) NULL ,
[carrier_id] nvarchar(80) NULL ,
[transportation_method] nvarchar(2) NULL ,
[carrier_reference_number] nvarchar(30) NULL ,
[bill_of_lading_number] nvarchar(30) NULL ,
[shipped_date] datetime NULL ,
[delivered_date] datetime NULL ,
[estimated_delivery_date] datetime NULL ,
[ship_to_name] nvarchar(60) NULL ,
[ship_to_id] nvarchar(80) NULL ,
[ship_to_city] nvarchar(30) NULL ,
[ship_to_state] nvarchar(2) NULL ,
[ship_to_postal] nvarchar(15) NULL ,
[ship_from_name] nvarchar(60) NULL ,
[ship_from_id] nvarchar(80) NULL ,
[ship_from_address] nvarchar(55) NULL ,
[ship_from_address_add] nvarchar(55) NULL ,
[ship_from_city] nvarchar(30) NULL ,
[ship_from_state] nvarchar(2) NULL ,
[ship_from_postal] nvarchar(15) NULL 
)


GO

-- ----------------------------
-- Records of tesla_856_header
-- ----------------------------
INSERT INTO [dbo].[tesla_856_header] ([id], [status], [create_datetime], [notice_number], [packing_slip_number], [shipment_date], [gross_weight], [gross_weight_unit], [actual_net_weight], [actual_net_weight_unit], [packing_type], [lading_qty], [weight], [weight_unit], [volume], [volume_unit], [carrier_id], [transportation_method], [carrier_reference_number], [bill_of_lading_number], [shipped_date], [delivered_date], [estimated_delivery_date], [ship_to_name], [ship_to_id], [ship_to_city], [ship_to_state], [ship_to_postal], [ship_from_name], [ship_from_id], [ship_from_address], [ship_from_address_add], [ship_from_city], [ship_from_state], [ship_from_postal]) VALUES (N'1', N'0', N'2023-06-08 15:52:02.000', N'202306080001', N'PSN890089', N'2023-06-08 15:52:16.000', N'21', N'KG', N'15', N'KG', N'L', N'78', N'156.000', N'KG', N'12', N'L', N'546557', N'S', N'3435', N'BL64535', N'2023-06-08 15:54:27.000', N'2023-06-30 15:54:30.000', N'2023-06-30 15:54:37.000', N'TEST', N'0001', N'BJ', N'BJ', N'00002', N'XA', N'00002', N'ADDR1', null, N'XA', N'XA', N'702000')
GO
GO

-- ----------------------------
-- Indexes structure for table tesla_856_header
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_856_header
-- ----------------------------
ALTER TABLE [dbo].[tesla_856_header] ADD PRIMARY KEY ([id])
GO



/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-20 16:07:50
*/


-- ----------------------------
-- Table structure for tesla_856_pack
-- ----------------------------
DROP TABLE [dbo].[tesla_856_pack]
GO
CREATE TABLE [dbo].[tesla_856_pack] (
[id] nvarchar(50) NOT NULL ,
[header_id] nvarchar(50) NULL ,
[purchase_order_number] nvarchar(22) NULL ,
[purchase_order_date] datetime NULL ,
[tare_length] nvarchar(8) NULL ,
[tare_width] nvarchar(8) NULL ,
[tare_height] nvarchar(8) NULL ,
[tare_unit] nvarchar(2) NULL ,
[pallet_mark] nvarchar(35) NULL ,
[box_mark] nvarchar(35) NULL ,
[type] nvarchar(255) NULL ,
[buyer_line_item_number] nvarchar(255) NULL ,
[buyer_part_number] nvarchar(255) NULL ,
[upc_number] nvarchar(255) NULL ,
[origin_country] nvarchar(255) NULL ,
[international_number] nvarchar(255) NULL ,
[shipped_qty] nvarchar(255) NULL ,
[measurement] nvarchar(255) NULL ,
[lot_number] nvarchar(255) NULL ,
[serial_number] nvarchar(255) NULL 
)


GO

-- ----------------------------
-- Records of tesla_856_pack
-- ----------------------------
INSERT INTO [dbo].[tesla_856_pack] ([id], [header_id], [purchase_order_number], [purchase_order_date], [tare_length], [tare_width], [tare_height], [tare_unit], [pallet_mark], [box_mark], [type], [buyer_line_item_number], [buyer_part_number], [upc_number], [origin_country], [international_number], [shipped_qty], [measurement], [lot_number], [serial_number]) VALUES (N'1', N'1', N'PO12345', N'2023-05-09 15:57:25.000', N'12', N'30', N'50', N'M', N'PM0-83974', N'BOX83890', N'M', N'1', N'1', N'1', N'1', N'1', N'1', N'1', N'1', N'1')
GO
GO
INSERT INTO [dbo].[tesla_856_pack] ([id], [header_id], [purchase_order_number], [purchase_order_date], [tare_length], [tare_width], [tare_height], [tare_unit], [pallet_mark], [box_mark], [type], [buyer_line_item_number], [buyer_part_number], [upc_number], [origin_country], [international_number], [shipped_qty], [measurement], [lot_number], [serial_number]) VALUES (N'2', N'1', N'PO12345', N'2023-05-09 15:57:25.000', N'12', N'30', N'50', N'M', N'PM0-83974', N'BOX25689', N'M', N'1', N'1', N'1', N'1', N'1', N'1', N'1', N'1', N'1')
GO
GO
INSERT INTO [dbo].[tesla_856_pack] ([id], [header_id], [purchase_order_number], [purchase_order_date], [tare_length], [tare_width], [tare_height], [tare_unit], [pallet_mark], [box_mark], [type], [buyer_line_item_number], [buyer_part_number], [upc_number], [origin_country], [international_number], [shipped_qty], [measurement], [lot_number], [serial_number]) VALUES (N'3', N'1', N'PO12345', N'2023-05-09 15:57:25.000', N'12', N'30', N'50', N'M', N'PM0-83975', N'BOX25222', N'G', N'2', N'2', N'2', N'2', N'2', N'2', N'2', N'2', N'2')
GO
GO
INSERT INTO [dbo].[tesla_856_pack] ([id], [header_id], [purchase_order_number], [purchase_order_date], [tare_length], [tare_width], [tare_height], [tare_unit], [pallet_mark], [box_mark], [type], [buyer_line_item_number], [buyer_part_number], [upc_number], [origin_country], [international_number], [shipped_qty], [measurement], [lot_number], [serial_number]) VALUES (N'4', N'1', N'PO12345', N'2023-05-09 15:57:25.000', N'12', N'30', N'50', N'M', N'PM0-83975', N'BOX25223', N'G', N'1', N'1', N'1', N'1', N'1', N'1', N'1', N'1', N'1')
GO
GO
INSERT INTO [dbo].[tesla_856_pack] ([id], [header_id], [purchase_order_number], [purchase_order_date], [tare_length], [tare_width], [tare_height], [tare_unit], [pallet_mark], [box_mark], [type], [buyer_line_item_number], [buyer_part_number], [upc_number], [origin_country], [international_number], [shipped_qty], [measurement], [lot_number], [serial_number]) VALUES (N'5', N'1', N'PO12345', N'2023-05-09 15:57:25.000', N'', N'', N'', N'', null, N'BOX11111', N'P', N'2', N'2', N'2', N'2', N'2', N'2', N'2', N'2', N'2')
GO
GO

-- ----------------------------
-- Indexes structure for table tesla_856_pack
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_856_pack
-- ----------------------------
ALTER TABLE [dbo].[tesla_856_pack] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[tesla_856_pack]
-- ----------------------------
ALTER TABLE [dbo].[tesla_856_pack] ADD FOREIGN KEY ([header_id]) REFERENCES [dbo].[tesla_856_header] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-12 10:36:18
*/


-- ----------------------------
-- Table structure for tesla_810_header
-- ----------------------------
DROP TABLE [dbo].[tesla_810_header]
GO
CREATE TABLE [dbo].[tesla_810_header] (
[id] nvarchar(50) NOT NULL ,
[status] int NULL ,
[create_datetime] datetime NULL ,
[invoice_create_date] datetime NULL ,
[invoice_number] nvarchar(22) NULL ,
[purchase_order_date] datetime NULL ,
[currency] nvarchar(3) NULL ,
[packing_list_number] nvarchar(30) NULL ,
[invoice_issuer] nvarchar(60) NULL ,
[invoice_issuer_id] nvarchar(80) NULL ,
[discount_percent] nvarchar(6) NULL ,
[discount_day_due] nvarchar(3) NULL ,
[net_due_date] datetime NULL ,
[net_days] nvarchar(3) NULL ,
[description] nvarchar(80) NULL ,
[invoice_tatal_amount] decimal(15,3) NULL ,
[shipped_qty] nvarchar(80) NULL ,
[unit] nvarchar(3) NULL ,
[weight] nvarchar(80) NULL ,
[weight_unit] nvarchar(3) NULL 
)


GO

-- ----------------------------
-- Records of tesla_810_header
-- ----------------------------
INSERT INTO [dbo].[tesla_810_header] ([id], [status], [create_datetime], [invoice_create_date], [invoice_number], [purchase_order_date], [currency], [packing_list_number], [invoice_issuer], [invoice_issuer_id], [discount_percent], [discount_day_due], [net_due_date], [net_days], [description], [invoice_tatal_amount], [shipped_qty], [unit], [weight], [weight_unit]) VALUES (N'1', N'3', N'2023-06-09 12:28:20.000', N'2023-06-09 12:28:22.000', N'CI9092009', N'2023-06-09 12:28:42.000', N'USD', N'pk09879088', N'Tom', N'00001', N'10', N'30', N'2023-06-09 12:29:13.000', N'30', N'DESC', N'1300.000', N'100', N'EA', N'203', N'KG')
GO
GO

-- ----------------------------
-- Indexes structure for table tesla_810_header
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_810_header
-- ----------------------------
ALTER TABLE [dbo].[tesla_810_header] ADD PRIMARY KEY ([id])
GO


/*
Navicat SQL Server Data Transfer

Source Server         : sqlserver
Source Server Version : 150000
Source Host           : 192.168.1.106:1433
Source Database       : SunnyTest
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 150000
File Encoding         : 65001

Date: 2023-06-12 10:36:26
*/


-- ----------------------------
-- Table structure for tesla_810_detail
-- ----------------------------
DROP TABLE [dbo].[tesla_810_detail]
GO
CREATE TABLE [dbo].[tesla_810_detail] (
[id] nvarchar(50) NOT NULL ,
[header_id] nvarchar(50) NULL ,
[po_line_item_number] nvarchar(20) NULL ,
[invoice_qty] decimal(10) NULL ,
[unit_code] nvarchar(2) NULL ,
[unit_price] decimal(17) NULL ,
[price_type] nvarchar(2) NULL ,
[buyer_item_number] nvarchar(48) NULL ,
[purchase_order_number] nvarchar(48) NULL ,
[vendor_part_number] nvarchar(48) NULL ,
[tax] decimal(18) NULL 
)


GO

-- ----------------------------
-- Records of tesla_810_detail
-- ----------------------------
INSERT INTO [dbo].[tesla_810_detail] ([id], [header_id], [po_line_item_number], [invoice_qty], [unit_code], [unit_price], [price_type], [buyer_item_number], [purchase_order_number], [vendor_part_number], [tax]) VALUES (N'1', N'1', N'0001', N'300', N'EA', N'12', N'D', N'I87479093', N'PO0RHR74', N'V793495FG', N'13')
GO
GO

-- ----------------------------
-- Indexes structure for table tesla_810_detail
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table tesla_810_detail
-- ----------------------------
ALTER TABLE [dbo].[tesla_810_detail] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[tesla_810_detail]
-- ----------------------------
ALTER TABLE [dbo].[tesla_810_detail] ADD FOREIGN KEY ([header_id]) REFERENCES [dbo].[tesla_810_header] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO
